#pragma once

#include "common.h"

/*---------------------------------------------------------------------------*/
/*                                Image Data                                 */
/*---------------------------------------------------------------------------*/

#define IMG_OBJECT_W        8
#define IMG_OBJECT_H        8
#define IMG_OBJECT_ID_MAX   11

PROGMEM static const uint8_t imgObject[IMG_OBJECT_ID_MAX][8] = { // 8x8 x8
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }, // Empty
    { 0xFF, 0xFF, 0xAA, 0xD5, 0xAA, 0xD5, 0xAA, 0x80 }, // Box 
    { 0x3C, 0x7E, 0xFF, 0xFF, 0xFF, 0xFF, 0x7E, 0x3C }, // Ball
    { 0x3C, 0x76, 0xE7, 0xC7, 0xE7, 0xF7, 0x7E, 0x3C }, // Ball (Left)
    { 0x3C, 0x6E, 0xE7, 0xE3, 0xE7, 0xEF, 0x7E, 0x3C }, // Ball (Right)
    { 0x18, 0x18, 0xFF, 0x7E, 0x3C, 0x3C, 0x7E, 0x66 }, // Star
    { 0x18, 0x18, 0xE7, 0x42, 0x24, 0x24, 0x5A, 0x66 }, // Star (Blink)
    { 0x24, 0x5A, 0x66, 0x81, 0x81, 0x42, 0x99, 0xE7 }, // Enemy
    { 0x00, 0x00, 0x3C, 0x76, 0xA1, 0x4A, 0x9D, 0xEF }, // Dying enemy 1
    { 0x00, 0x00, 0x00, 0x00, 0x20, 0x76, 0x5A, 0xEF }, // Dying enemy 2
    { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x7C }, // Dying enemy 3
};

#define IMG_READY_W 14
#define IMG_READY_H 40

PROGMEM static const uint8_t imgReady[70] = { // 14x40
    0x00, 0x00, 0x00, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0xF8, 0xF8, 0x18, 0xF8, 0xF8, 0x0C, 0x0C,
    0x0C, 0xFD, 0xFD, 0xCD, 0xCD, 0xCD, 0xCD, 0xFD, 0xFD, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x7E,
    0x7E, 0x06, 0x7E, 0x7E, 0x66, 0x7E, 0x7E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xBF, 0xBF, 0x33,
    0x3F, 0x3F, 0x30, 0x3F, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x18, 0x18, 0x18,
    0x18, 0x18, 0x18, 0x00, 0x00, 0x00
};

#define IMG_GAMEOVER1_W 8
#define IMG_GAMEOVER1_H 56

PROGMEM static const uint8_t imgGameOver1[56] = { // 8x56
    0xFC, 0xFC, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0x7E, 0x7E, 0x66, 0x7E, 0x7E, 0x60, 0x7E, 0x7E,
    0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB7, 0xBE, 0xBC, 0x9F, 0x9F, 0x99, 0x99, 0x99, 0x19, 0x9F, 0x9F,
    0xDF, 0xDF, 0xD9, 0xDF, 0xDF, 0xD8, 0xDF, 0xDF, 0xFF, 0xFF, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC, 0xCC,
    0x7E, 0x7E, 0x06, 0x7E, 0x7E, 0x66, 0x7E, 0x7E
};

#define IMG_GAMEOVER2_W 11
#define IMG_GAMEOVER2_H 8

PROGMEM static const uint8_t imgGameOver2[11] = { // 11x8
    0x3F, 0x3F, 0x33, 0x33, 0x33, 0x33, 0x3F, 0x3F, 0x03, 0x3F, 0x3F
};

/*---------------------------------------------------------------------------*/
/*                                Sound Data                                 */
/*---------------------------------------------------------------------------*/

enum {
    SND_PRIO_START = 0,
    SND_PRIO_OVER,
    SND_PRIO_EFFECT,
    SND_PRIO_CONTROL,
};

PROGMEM static const byte soundStart[] = {
    0x90, 0x48, 0x00, 0x64, 0x90, 0x4A, 0x00, 0x64, 0x90, 0x4C, 0x00, 0x64, 0x90, 0x4D, 0x00, 0x64,
    0x90, 0x4F, 0x00, 0xC8, 0x80, 0xF0
};

PROGMEM static const byte soundOver[] = {
    0x90, 0x37, 0x00, 0x78, 0x90, 0x36, 0x00, 0x8C, 0x90, 0x35, 0x00, 0xA0, 0x90, 0x34, 0x00, 0xB4,
    0x90, 0x33, 0x00, 0xC8, 0x90, 0x32, 0x00, 0xDC, 0x90, 0x31, 0x00, 0xF0, 0x90, 0x30, 0x00, 0xFF,
    0x80, 0xF0
};

PROGMEM static const byte soundRotate[] = {
    0x90, 0x58, 0x00, 0x0A, 0x90, 0x56, 0x00, 0x0A, 0x90, 0x54, 0x00, 0x0A, 0x90, 0x52, 0x00, 0x0A,
    0x90, 0x50, 0x00, 0x0A, 0x80, 0xF0
};

PROGMEM static const byte soundFall[] = {
    0x90, 0x37, 0x00, 0x0C, 0x90, 0x34, 0x00, 0x0C, 0x90, 0x30, 0x00, 0x0C, 0x90, 0x38, 0x00, 0x08,
    0x90, 0x35, 0x00, 0x08, 0x90, 0x31, 0x00, 0x08, 0x80, 0xF0
};

PROGMEM static const byte soundErase[] = {
    0x90, 0x74, 0x00, 0x14, 0x90, 0x68, 0x00, 0x18, 0x90, 0x5C, 0x00, 0x1C, 0x90, 0x50, 0x00, 0x20,
    0x90, 0x44, 0x00, 0x24, 0x90, 0x38, 0x00, 0x28, 0x80, 0xF0
};

PROGMEM static const byte soundKill[] = {
    0x90, 0x43, 0x00, 0x0A, 0x90, 0x4F, 0x00, 0x0A, 0x90, 0x4C, 0x00, 0x0A, 0x80, 0xF0
};

PROGMEM static const byte soundStar[] = {
    0x90, 0x60, 0x00, 0x1E, 0x90, 0x61, 0x00, 0x1E, 0x90, 0x62, 0x00, 0x1E, 0x90, 0x63, 0x00, 0x1E,
    0x90, 0x64, 0x00, 0x1E, 0x90, 0x65, 0x00, 0x1E, 0x90, 0x66, 0x00, 0x1E, 0x90, 0x67, 0x00, 0x1E,
    0x80, 0xF0
};

PROGMEM static const byte soundStarCancel[] = {
    0x90, 0x44, 0x00, 0x3C, 0x90, 0x47, 0x00, 0x3C, 0x90, 0x49, 0x00, 0x3C, 0x80, 0xF0
};

PROGMEM static const byte soundLevel1Up[] = {
    0x90, 0x68, 0x00, 0x14, 0x80, 0x00, 0x14, 0x90, 0x68, 0x00, 0x14, 0x80, 0xF0
};

PROGMEM static const byte soundLevel5Up[] = {
    0x90, 0x49, 0x00, 0x50, 0x90, 0x4D, 0x00, 0x78, 0x80, 0x00, 0x50, 0x90, 0x49, 0x00, 0x50, 0x90,
    0x4D, 0x00, 0x78, 0x80, 0x00, 0x50, 0x90, 0x49, 0x00, 0x50, 0x90, 0x4D, 0x00, 0x78, 0x80, 0x00,
    0x50, 0x80, 0xF0
};
